import utils from '../../core/utils';
import { appInfo } from '../apis/appInfo';
import { appStatus } from '../enums/appStatus';

export default class applicationInfo {
  constructor(obj?: appInfo) {
    if (!utils.isEmpty(obj)) {
      this.id = obj.id;
      this.name = obj.name;
      this.desc = obj.desc;
      this.icon = obj.icon;
      this.vender = obj.vender;
      this.packageName = obj.packageName;
      this.version = obj.version;
      this.typeId = obj.typeId;
      this.userId = obj.userId;
      this.projectUrl = obj.projectUrl;
      this.createTime = obj.createTime;
      this.system = false;
      this.enabled = true;
      this.versionCode = '';
      this.entryAbilityName = '';
      this.status = appStatus.none;
    }
  }

  id: string;
  name: string;
  desc: string;
  icon: string;
  vender: string;
  packageName: string;
  version: string;
  typeId: number;
  userId: string;
  projectUrl: string;
  createTime: Date;

  system: boolean;
  enabled: boolean;
  status: appStatus;
  versionCode: string;
  entryAbilityName: string;
}